import request from '@/utils/request'

// 查询人员信息列表
export function listPerson (query) {
	return request({
		url: '/person/person/list',
		method: 'get',
		params: query
	})
}

// 查询人员信息详细
export function getPerson (id) {
	return request({
		url: '/person/person/' + id,
		method: 'get'
	})
}

// 新增人员信息
export function addPerson (data) {
	return request({
		url: '/person/person',
		method: 'post',
		data: data
	})
}

// 修改人员信息
export function updatePerson (data) {
	return request({
		url: '/person/person',
		method: 'put',
		data: data
	})
}

// 删除人员信息
export function delPerson (id) {
	return request({
		url: '/person/person/' + id,
		method: 'delete'
	})
}

// 获取下拉人员列表
export function selectPerson (query) {
	return request({
		url: '/person/person/selectList',
		method: 'get',
		params: query
	})
}

// 获取承包商列表
export function getContractors (query) {
	return request({
		url: 'person/contractor/allList',
		method: 'get'
	})
}



//模板下载
export function expotModel () {
	return request({
		url: '/person/person/expotModel',
		method: 'get',
		responseType: 'blob',
	})
}

//同步人员信息
export function syncPerson () {
	return request({
		url: '/person/person/syncPerson',
		method: 'get'
	})
}
//同步闸机人员信息
export function syncGatePerson (data) {
	return request({
		url: '/person/person/syncGatePerson',
		method: 'post',
		data: data
	})
}

export function listAllPerson (query) {
	return request({
		url: '/person/person/listAll',
		method: 'get',
		params: query
	})
}

//账号建立
export function createPerson (id) {
	return request({
		url: '/person/person/sync/' + id,
		method: 'get'
	})
}

